package com.smmisia.article.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.Getter;

@Getter
public enum FriendEnum {

    FRIEND_STATUS_PENDING(0, "待确认"),
    FRIEND_STATUS_AGREE(1, "已同意"),
    FRIEND_STATUS_REFUSE(2, "已拒绝"),
    Friend_STATUS_BLANK(3, "黑名单");

    @EnumValue
    private final Integer code;
    private final String desc;

    FriendEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static FriendEnum getEnum(Integer code) {
        for (FriendEnum friendEnum : FriendEnum.values()) {
            if (friendEnum.getCode().equals(code)) {
                return friendEnum;
            }
        }
        return null;
    }
}
